#!/bin/bash

echo "编译和运行队列演示程序"
echo "========================"

# 编译C++程序
echo "1. 编译C++程序..."
g++ -std=c++11 -o queue_cpp queue.cpp

if [ $? -eq 0 ]; then
    echo "C++编译成功！"
    echo "运行C++程序:"
    echo "=================="
    ./queue_cpp
    echo "=================="
    echo ""
else
    echo "C++编译失败！"
fi

# 运行Python程序
echo "2. 运行Python程序..."
echo "=================="
python3 queue.py
echo "=================="
echo ""

# 运行Go程序
echo "3. 运行Go程序..."
echo "=================="
go run queue.go
echo "=================="

echo "所有程序运行完成！"
